﻿using System.Data.Entity;
using System.Data.Entity.ModelConfiguration.Conventions;
using JinRi.Services.Domains;
using MySql.Data.Entity;

namespace JinRi.Services
{
    [DbConfigurationType(typeof(MySqlEFConfiguration))]
    public class JinRiContext : DbContext
    {
        public JinRiContext() : base("JinRi") { }

        public DbSet<User> Users { get; set; }

        public DbSet<Image> Images { get; set; }
        public DbSet<About> Abouts { get; set; }
        public DbSet<Award> Awards { get; set; }
        public DbSet<Banner> Banners { get; set; }
        public DbSet<Contact> Contacts { get; set; }
        public DbSet<Job> Jobs { get; set; }
        public DbSet<News> News { get; set; }
        public DbSet<Product> Products { get; set; }
        public DbSet<Video> Videos { get; set; }

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            modelBuilder.Conventions.Remove<PluralizingTableNameConvention>();
        }
    }
}